// 用于定义医院设置页面所有的请求函数
import { request } from '@utils/http'

// 引入ts类型
import {
  IhospitalSetRes,
  Iaddhos,
  IhospitalSetItem,
} from './model/hospitalSetTypes'
// 获取医院设置表格数据
export function reqGetHospitalSet(
  page: number,
  limit: number,
  hosname?: string,
  hoscode?: string
) {
  return request.get<any, IhospitalSetRes>(
    `/admin/hosp/hospitalSet/${page}/${limit}`,
    {
      params: {
        hosname,
        hoscode,
      },
    }
  )
}
//添加医院设置
export function reqAddHospitalSet(data: Iaddhos) {
  return request.post<any, null>(`/admin/hosp/hospitalSet/save`, data)
}
//获取一条医院设置
export function reqGetOneHospitalSet(id: string) {
  return request.get<any, IhospitalSetItem>(`/admin/hosp/hospitalSet/get/${id}`)
}
//修改一条医院设置
export function reqEditOneHospitalSet(data: IhospitalSetItem) {
  return request.put<any, null>(`/admin/hosp/hospitalSet/update`, data)
}
//修改一条医院设置
export function reqDelOneHospitalSet(id: string) {
  return request.delete<any, null>(`/admin/hosp/hospitalSet/remove/${id}`)
}
